package com.xuerhua.yxt.websocket.model;

import java.io.Serializable;

import com.alibaba.fastjson.JSONObject;

public class Message implements Serializable {

	private static final long serialVersionUID = 2589505197554813212L;

	private User user;
	//消息类型 text文本 image图片
	private String messageType;
	//消息
	private String message;
	//发送人
	private String fromUser;
	//接收人
	private String toUser;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getMessageType() {
		return messageType;
	}

	public void setMessageType(String messageType) {
		this.messageType = messageType;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getFromUser() {
		return fromUser;
	}

	public void setFromUser(String fromUser) {
		this.fromUser = fromUser;
	}

	public String getToUser() {
		return toUser;
	}

	public void setToUser(String toUser) {
		this.toUser = toUser;
	}
	
	public String toJson() {
		return JSONObject.toJSONString(this);
	}
}
